﻿using System;
using System.Collections.Generic;
using System.Text;
using Gmmy.DomainExtension;
using Newtonsoft.Json;
using Surging.Core.CPlatform.Ioc;
using Surging.Core.System.Intercept;


namespace Gmmy.DomainExtension
{
    
    public class EmptyRequest : BaseRequest
    {
        /// <summary>
        /// 获取简单用户信息
        /// </summary>
        /// <returns></returns>
        public LoginInfoDto GetAuthInfo()
        {
            try
            {
                if (string.IsNullOrWhiteSpace(AuthInfo))
                {
                    return null;
                }
                return JsonConvert.DeserializeObject<LoginInfoDto>(AuthInfo);
            }
            catch (Exception e)
            {
                return null;
            }
        }
        /// <summary>
        /// 获取客户端信息
        /// </summary>
        /// <returns></returns>
        public RequestInfo GetRequestInfo()
        {
            try
            {
                if (string.IsNullOrWhiteSpace(RequestInfo))
                {
                    return new RequestInfo();
                }
                return JsonConvert.DeserializeObject<RequestInfo>(RequestInfo);
            }
            catch (Exception e)
            {
                return new RequestInfo();
            }
        }
    }

    public class RequestInfo
    {
        public string IpAddress { get; set; }
    }
}
